package com.xuecheng.checkcode.fallback;

import com.xuecheng.checkcode.feignclient.AuthServiceClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class AuthClientFactory implements FallbackFactory<AuthServiceClient> {
    @Override
    public AuthServiceClient create(Throwable throwable) {
        return new AuthServiceClient() {
            @Override
            public void sendSms(String phoneNumbers) {
                log.info("调用手机发送验证码时发生熔断，异常信息:{}",throwable.toString(),throwable);
            }
        };
    }
}
